<?php
header("content-type:text/html;charset=utf8");
// 获取传入的数据
$cartid = $_GET["cartid"];
// 连接数据库
$link= mysqli_connect("localhost","root","","user");
mysqli_set_charset($link,"utf8");
$sql = "select * from onlygoods where cart_id='$cartid'";
$result= mysqli_query($link,$sql);
$row=mysqli_fetch_assoc($result);
echo json_encode($row);
mysqli_close($link);

?>